<template>
	<div class="zk-wiki-view" v-if="viewModel">
		<div class="content">
			<h1 class="title">{{project.name}}</h1>
			<div class="intro">{{project.intro}}</div>
			<tree @viewWiki="viewWiki" :list="viewModel.wikis" :projectId="project.id"></tree>
		</div>
	</div>
</template>
<script>
	import ala from 'ala'
	import tree from './tree'
	export default {
		components: {
			tree
		},
		props: {
			project: {}
		},
		data() {
			return {
				viewModel: null
			}
		},
		methods: {
			init(data) {
				this.viewModel = data
				this.$forceUpdate()
			},
			viewWiki(data) {
				this.$emit('viewWiki', data)
			}
		}
	}
</script>
<style lang="scss" scoped>
	.zk-wiki-view {
		overflow: auto;
		width: 100%;
		background: #ffffff;

		.content {
			margin: 0 auto;
			padding: 2rem 2.5rem;

			.title {
				font-size: 25px;
				line-height: 30px;
			}

			.intro {
				line-height: 40px;
			}
		}
	}
</style>